Skip to content

Integrate Hermes CDPDebugAPI with RN console polyfill#43454

Closed
motiz88 wants to merge 2 commits into
facebook:mainfrom
motiz88:export-D54494298
Closed

Integrate Hermes CDPDebugAPI with RN console polyfill#43454
motiz88 wants to merge 2 commits into
facebook:mainfrom
motiz88:export-D54494298

Conversation

@motiz88

@motiz88 motiz88 commented Mar 13, 2024

Copy link
Copy Markdown
Contributor

Summary:
Changelog: [Internal]

  1. Introduces the RuntimeTargetDelegate::addConsoleMessage method, which is a 1:1 wrapper around the Hermes CDPDebugAPI method of the same name.
  2. Installs a global __inspectorLog function callable from JS, matching this existing call in React Native's console polyfill.

NOTE: We'll almost immediately replace __inspectorLog with a standalone native implementation of the console API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full console spec, which requires some more C++ code and boilerplate.

Differential Revision: D54494298

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 13, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D54494298

@analysis-bot

analysis-bot commented Mar 13, 2024

Copy link
Copy Markdown
Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 18,086,154 +12,295
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 21,452,895 +12,297
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 4f10f30
Branch: main

motiz88 added 2 commits March 13, 2024 04:44
Summary:

Changelog: [Internal]

1. Introduces the `RuntimeTargetDelegate::addConsoleMessage` method, which is a 1:1 wrapper around the Hermes `CDPDebugAPI` [method of the same name](https://github.com/facebook/hermes/blob/33cf8cfe781aabcad6b3d39821d815fe5317f977/API/hermes/cdp/CDPDebugAPI.h#L43-L47).
2. Installs a global `__inspectorLog` function callable from JS, matching [this existing call](https://github.com/facebook/react-native/blob/4f10f3069fff9090d700d9bcfbf49da1aa85f272/packages/polyfills/console.js#L430-L437) in React Native's `console` polyfill.

NOTE: We'll almost immediately replace `__inspectorLog` with a standalone native implementation of the `console` API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full `console` spec, which requires some more C++ code and boilerplate.

Differential Revision: D54494298
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D54494298

motiz88 added a commit to motiz88/react-native that referenced this pull request Mar 13, 2024
Summary:

Changelog: [Internal]

1. Introduces the `RuntimeTargetDelegate::addConsoleMessage` method, which is a 1:1 wrapper around the Hermes `CDPDebugAPI` [method of the same name](https://github.com/facebook/hermes/blob/33cf8cfe781aabcad6b3d39821d815fe5317f977/API/hermes/cdp/CDPDebugAPI.h#L43-L47).
2. Installs a global `__inspectorLog` function callable from JS, matching [this existing call](https://github.com/facebook/react-native/blob/4f10f3069fff9090d700d9bcfbf49da1aa85f272/packages/polyfills/console.js#L430-L437) in React Native's `console` polyfill.

NOTE: We'll almost immediately replace `__inspectorLog` with a standalone native implementation of the `console` API that doesn't depend on the polyfill, but this is an easy way to validate the approach before tackling the full `console` spec, which requires some more C++ code and boilerplate.

Reviewed By: huntie

Differential Revision: D54494298
@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 13, 2024
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 51e0b3a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants